package com.example.once.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.once.common.Result;
import com.example.once.entity.RecordVO;
import com.example.once.mapper.RecordMapper;
import com.example.once.common.PageQuery;
import com.example.once.service.RecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xinTong
 * @since 2023-12-16
 */
@RestController
@RequestMapping("/record")
public class RecordController {

    @Autowired
    private RecordService recordService;
    @Autowired
    private RecordMapper recordMapper;

    /**
     * 查
     * @param query
     * @return
     */
    @PostMapping("/select")
    public Result select(@RequestBody PageQuery query) {

        IPage<RecordVO> iPage = recordService.pageQuery(query);

        return Result.suc(iPage.getRecords(), iPage.getTotal());
    }

}
